package com.example.administrator.yanfoxconn.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.example.administrator.yanfoxconn.R;
import com.example.administrator.yanfoxconn.constant.FoxContext;
import com.example.administrator.yanfoxconn.utils.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @Description 公共倆按鈕界面
 * @Author song
 * @Date 3/10/22 9:36 AM
 */
public class TwoButtonActivity extends BaseActivity implements View.OnClickListener{
    @BindView(R.id.btn_title_left)
    Button btnBack;//返回
    @BindView(R.id.tv_title)
    TextView tvTitle;//標題

    @BindView(R.id.btn_one)
    Button btnOne;//裝
    @BindView(R.id.btn_two)
    Button btnTwo;//卸

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_com_2btn);
        ButterKnife.bind(this);
        btnBack.setOnClickListener(this);
        btnOne.setOnClickListener(this);
        btnTwo.setOnClickListener(this);
        if (FoxContext.getInstance().getType().equals("LR")){
            tvTitle.setText("車輛排配");
            btnOne.setText("收貨");
            btnTwo.setText("發貨");
        }else{}
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.btn_title_left:
                finish();
                break;
            case R.id.btn_one:
                Intent intent = new Intent(TwoButtonActivity.this,LRSearchListActivity.class);
                intent.putExtra("flag","FH");
                startActivity(intent);
                break;
            case R.id.btn_two:
                Intent intent2 = new Intent(TwoButtonActivity.this,LRSearchListActivity.class);
                intent2.putExtra("flag","SH");
                startActivity(intent2);
                break;
        }
    }
}
